Skip to content

Hitless upgrades #3021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft

Hitless upgrades #3021

wants to merge 10 commits into from

Conversation

nkaradzhov
Copy link
Collaborator

Description

Describe your pull request here


Checklist

  • Does npm test pass with this change (including linting)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

@nkaradzhov nkaradzhov force-pushed the hitless-upgrades branch 4 times, most recently from 96a2875 to fb0e62c Compare July 29, 2025 10:03
@nkaradzhov nkaradzhov force-pushed the hitless-upgrades branch 3 times, most recently from 6fdf77e to 25b258f Compare August 7, 2025 08:06
@nkaradzhov nkaradzhov force-pushed the hitless-upgrades branch 2 times, most recently from 4ae84a5 to c6ce47c Compare August 8, 2025 09:29
…narios

- Added `SocketTimeoutDuringMaintananceError`, a subclass of `TimeoutError`, to handle socket timeouts during maintenance.
- Added `CommandTimeoutDuringMaintananceError`, another subclass of `TimeoutError`, to address command write timeouts during maintenance.
…inkedList functionality

- Introduced `EmptyAwareSinglyLinkedList`, a subclass of `SinglyLinkedList` that emits an `empty` event when the list becomes empty due to `reset`, `shift`, or `remove` operations.
- Added `nodes()` iterator method to `DoublyLinkedList` for iterating over nodes directly.
- Enhanced unit tests for `DoublyLinkedList` and `SinglyLinkedList` to cover edge cases and new functionality.
- Added comprehensive tests for `EmptyAwareSinglyLinkedList` to validate `empty` event emission under various scenarios.
- Improved code formatting and consistency.
- Replaced `setInvalidateCallback` with a more flexible `addPushHandler` method, allowing multiple handlers for push notifications.
- Introduced the `PushHandler` type to standardize push notification processing.
- Refactored `RedisCommandsQueue` to use a `#pushHandlers` array, enabling dynamic and modular handling of push notifications.
- Updated `RedisClient` to leverage the new handler mechanism for `invalidate` push notifications, simplifying and decoupling logic.
…mplete

- Introduced `waitForInflightCommandsToComplete` method to asynchronously wait for all in-flight commands to finish processing.
- Utilized the `empty` event from `#waitingForReply` to signal when all commands have been completed.
…-queuefd

- Added `#inMaintenance` property and `set inMaintenance` setter to track maintenance mode state.
- Introduced `#maintenanceCommandTimeout` and `setMaintenanceCommandTimeout` method to dynamically adjust command timeouts during maintenance.
- Refactored timeout logic to prioritize `#maintenanceCommandTimeout` over individual command timeouts.
- `CommandTimeoutDuringMaintananceError` is used when in maintenance mode.
…s handling

- Changed `#initiateSocket` to a streamlined asynchronous method to handle socket readiness and initialization logic.
- Added `waitForReady` method to `RedisSocket` to await socket readiness.
- Introduced `#createSocket` method in `RedisClient` to decouple socket creation from initialization logic.
- Refactored `connect` method to ensure proper socket readiness and initialization before proceeding.
…ndling

- Introduced `#inMaintenance` property and setter to track maintenance mode state in `RedisSocket`.
- Added `#maintenanceTimeout` and `setMaintenanceTimeout` method to dynamically adjust socket timeouts during maintenance.
- Enhanced timeout error handling to differentiate between regular timeouts (`SocketTimeoutError`) and maintenance-specific timeouts (`SocketTimeoutDuringMaintananceError`).
- Introduced `maintPushNotifications` option to control how the client handles Redis Enterprise maintenance push notifications (`disabled`, `enabled`, `auto`).
- Added `maintMovingEndpointType` option to specify the endpoint type for reconnecting during a MOVING notification (`auto`, `internal-ip`, `external-ip`, etc.).
- Added `maintRelaxedCommandTimeout` option to define a relaxed timeout for commands during maintenance.
- Added `maintRelaxedSocketTimeout` option to define a relaxed timeout for the socket during maintenance.
- Enforced RESP3 requirement for maintenance-related features (`maintPushNotifications`).
- Introduced `#pausedForMaintenance` flag to temporarily halt writing commands to the socket during maintenance windows.
- Added `#resumeFromMaintenance` method to handle socket replacement and resume operations after maintenance.
- Updated `#write` method to respect the `#pausedForMaintenance` flag, preventing new commands from being written during maintenance.
- Introduced `EnterpriseMaintenanceManager` to manage Redis Enterprise maintenance events and push notifications.
- Integrated `EnterpriseMaintenanceManager` into `RedisClient` to handle maintenance push notifications and manage socket transitions.
- Implemented graceful handling of MOVING, MIGRATING, and FAILOVER push notifications, including socket replacement and timeout adjustments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant